import api from './request'
//通过code换取openid
const codeExchangeOpenid = (data) => api.post('/api/codeExchangeOpenid', data)
//注册
const register = (data) => api.post('/api/register', data)
//重新获取token
const refreshToken = (data) => api.post('/api/refreshToken', data)
//商品分类
const goodType = (data) => api.get('/api/goodType', data)
//商品列表
const goodList = (data) => api.post('/api/goodList', data)
//首页商品列表
const homeGoodList = (data) => api.post('/api/homeGoodList', data)
//商品详情
const goodInfo = (data) => api.post('/api/goodInfo', data)
//banner
const bannerList = (data) => api.get('api/bannerList', data)
//地址列表
const userAddressList = (data) => api.post('/api/userAddressList', data)
//新增修改地址
const userAddressAddModify = (data) => api.post('/api/userAddressAddModify', data)
//删除地址
const userAddressDelete = (data) => api.post('/api/userAddressDelete', data)
//设置默认地址
const userAddressDfault = (data) => api.post('/api/userAddressDfault', data)
//新增修改购物车
const shoppingCarAddModify = (data) => api.post('/api/shoppingCarAddModify', data)
//删除购物车
const shoppingCarDelete = (data) => api.post('/api/shoppingCarDelete', data)
//购物车列表
const shoppingCarList = (data) => api.post('/api/shoppingCarList', data)
//生成订单
const generateOrder = (data) => api.post('/api/generateOrder', data)
//订单列表
const orderList = (data) => api.post('/api/orderList', data)
//订单重新支付
const rePayOrder = (data) => api.post('/api/rePayOrder', data)
//退款
const refund = (data) => api.post('/api/refund', data)



module.exports = {
  goodType,
  goodList,
  goodInfo,
  bannerList,
  codeExchangeOpenid,
  register,
  refreshToken,
  homeGoodList,
  userAddressAddModify,
  userAddressDelete,
  userAddressList,
  userAddressDfault,
  shoppingCarAddModify,
  shoppingCarDelete,
  shoppingCarList,
  generateOrder,
  orderList,
  rePayOrder,
  refund
}